package com.soft.javase.ch06.localDate;

import java.time.LocalDate;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/27
 */
public class LocalDateDemo {
    public static void main(String[] args) {
        //static LocalDate now() 获取当前时间
        LocalDate now = LocalDate.now();
        System.out.println("now = "+now);

        //static LocalDate of(int year , int month , int dayOfMonth)设置年月日
        LocalDate localDate = LocalDate.of(2025, 4, 1);
        System.out.println("localDate = "+localDate);

        //int compareTo(ChronoLocalDate other) 将此日期与另一个日期进行比较
        //默认先按照年进行比较，若年份相同则比较月份，若月份也相同则比较日期
        System.out.println(now.compareTo(localDate));

        //boolean equals(Object obj) 检查此日期是否等于另一个日期
        System.out.println(now.equals(localDate));
    }
}
